<html>
  <head>
    <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>从 Android Studio 开始你的编程之路吧🧐 | 夏元素的避风塘</title>
<meta name="description" content="理想生活+" />
<link rel="shortcut icon" href="https://Jason-summer.github.io/favicon.ico">
<link rel="stylesheet" href="https://Jason-summer.github.io/styles/main.css">

<script src="https://Jason-summer.github.io/media/js/jquery.min.js"></script>
<script src="https://Jason-summer.github.io/media/js/masonry.pkgd.min.js"></script>
<script src="https://Jason-summer.github.io/media/js/aos.js"></script>
<script src="https://Jason-summer.github.io/media/js/pace.min.js"></script>
<script src="https://Jason-summer.github.io/media/js/view-image.min.js"></script>
<script src="https://Jason-summer.github.io/media/js/jquery.magnific-popup.min.js"></script>
<script src="https://Jason-summer.github.io/media/js/functions.js"></script>
    <meta name="referrer" content="never">
    <meta name="description" content="
@牛顿：我和那些孩童没有什么区别，我不过是一个在沙滩上拾起贝壳研究的孩子，在真理之海面前瑟瑟发抖。

建立你的第一个工程（project）
新建工程

请注意：在 Android Studio 4.0 预览版中我无法启动离线模式，所以接下..." />
    <meta name="keywords" content="开发" />
    <script src="https://Jason-summer.github.io/media/js/waterfall.min.js"></script>
    <script src="https://Jason-summer.github.io/media/js/prism.min.js"></script>
  </head>
  <body>
            <header id="header" class="grid-container">
        <!-- start: .menu-wrapper -->
        <div class="menu-mobile"> 
          <i class="fa fa-reorder"></i>
        </div>
        <div class="menu-wrapper">
          <div class="">
            <div class="logo">
              <a href="https://Jason-summer.github.io"><img src="\media\images\custom-headerLogo.jpg" alt=""></a>
            </div>
            <!-- start: .main-nav -->

            <nav class="main-nav grid-container grid-parent">
              <ul id="menu-header" class="menu gradient-effect">
                <li class=""><a href="https://Jason-summer.github.io" class="menu">首页</a></li>
                
                  <li class="" >
                    <a href="/archives" class="menu">
                      归档
                    </a>
                  </li>
                
                  <li class="" >
                    <a href="/tags" class="menu">
                      标签
                    </a>
                  </li>
                
                  <li class="" >
                    <a href="/post/about" class="menu">
                      关于
                    </a>
                  </li>
                
                  <li class="" >
                    <a href="/movies" class="menu">
                      观影
                    </a>
                  </li>
                
                  <li class="" >
                    <a href="/books" class="menu">
                      书籍
                    </a>
                  </li>
                
                  <li class="" >
                    <a href="/friends" class="menu">
                      友人
                    </a>
                  </li>
                
                <li class="search-menu-item hide-on-mobile hide-on-tablet"><a href="#search-lightbox" class="lightbox mfp-inline"><i class="fa fa-search-line"></i></a></li>
              </ul>
            </nav>
            <a href="#search-lightbox" class="lightbox epcl-search-button mfp-inline hide-on-tablet hide-on-desktop"><i class="fa fa-search-line"></i></a>
            <!-- end: .main-nav -->
            <div class="clear"></div>
            <div class="border hide-on-tablet hide-on-mobile"></div>
          </div>    
          <div class="clear"></div>
        </div>
        <!-- end: .menu-wrapper -->
        <div class="clear"></div>
      </header>
      <div class="hide-on-mobile hide-on-tablet hide-on-desktop">
        <div id="search-lightbox" class="grid-container grid-small grid-parent mfp-hide">
          <div class="search-wrapper section">
            <form id="gridea-search-form" data-update="1588054322263" action="/search/index.html" class="search-form" _lpchecked="1">
              <input type="text" name="q" id="s" value="" class="search-field" placeholder="搜点啥..." aria-label="搜点啥..." required="">
              <button type="submit" class="submit" aria-label="Submit">
                <i class="fa fa-search-line"></i>
              </button>
            </form>
          </div>
        </div>
      </div>

      <main id="single" class="main grid-container fullcover no-sidebar aos-init aos-animate" data-aos="fade">

        <div class="center content">
          <div class="featured-image cover" style="background-image: url('https://Jason-summer.github.io/post-images/start-your-coding-with-android-studio.jpg');">
            <div class="meta top"> 
              <time class="meta-info" style="float:left;" datetime="2020-04-03"><i class="fa fa-calendar"></i><span class="lately">25 天前</span></time>
              
              <a href="https://Jason-summer.github.io/post/start-your-coding-with-android-studio/#comments" class="comments meta-info" title="">
                <i class="fa fa-comment remixicon"></i><span class="comment-count valine-comment-count" data-xid="/start-your-coding-with-android-studio/"> </span>
              </a>
              <span id="/start-your-coding-with-android-studio/" class="leancloud_visitors views-counter meta-info" title=""><i class="fa fa-leancloud remixicon"></i><span class="leancloud-visitors-count"></span></span>
              
            </div>
            <div class="info">
              <div class="tags ">
                
                      <a href="https://Jason-summer.github.io/tag/itPlsg2cI/" class="ctag ctag-0 ctag-itPlsg2cI" aria-label="">开发</a>
                    
              </div>
              <h1 class="title ularge white bold">从 Android Studio 开始你的编程之路吧🧐</h1>
            </div>
          </div>
        </div>  

        <div class="epcl-page-wrapper">
          <div class="left-content grid-70 np-mobile">
            <article class="main-article post">
              <section class="post-content">
                <div class="text">
                  <blockquote>
<p>@牛顿：我和那些孩童没有什么区别，我不过是一个在沙滩上拾起贝壳研究的孩子，在真理之海面前瑟瑟发抖。</p>
</blockquote>
<h2 id="建立你的第一个工程project">建立你的第一个工程（project）</h2>
<h3 id="新建工程">新建工程</h3>
<ul>
<li>请注意：在 Android Studio 4.0 预览版中我无法启动离线模式，所以接下来的内容基于 3.5.3 版本。<br>
包名：用网址以区分应用程序，请把 example.android.com 改成你自己的网站。<br>
语言：请将 Kotlin 改为 Java。使用 Kotlin 开发 Android 应用，使用 Kotlin 更快地编写更出色的 Android 应用。Kotlin 是一种静态类型的现代编程语言，不仅可以帮助您提高工作效率，而且还能让开发者工作起来更开心。<br>
最小SDK等级：你想创建的应用程序最低支持的安卓版本，请注意，如果SDK太小你可能无法使用很多新功能。<a href="http://en.wikipedia.org/wiki/Android_version_history">Android 版本历史 | 维基百科</a></li>
</ul>
<p>这个工程文件涵盖了 Java、XML、图片、音频之类的各种文件。</p>
<h3 id="解决来自-gradle-奇奇怪怪的问题难点">解决来自 gradle 奇奇怪怪的问题（难点）</h3>
<p>第一次使用时 gradle 需要同步一段时间，有点久。你可以看到下面这个通知栏，当它不再有一个圈转来转去的时候就完成了，这时 Build 栏里也没有圈圈了，于是我们可以把它关掉。左边是类似于资源管理器的树状文件结构，请找到并双击 app→res→layout→activity_mail.xml，把右边的更新内容也关掉，就可以看到 Preview 了。中间是类似于记事本的编辑区，请点击下方的 Text 查看和编辑代码。如果你遇到有关 gradle 的问题，这里有一些解决方法。来源：https://cloud.tencent.com/developer/article/1523424</p>
<h2 id="开始吧在你的手机或者模拟器上运行难点">开始吧！在你的手机或者模拟器上运行（难点）</h2>
<h3 id="复习一些知识">复习一些知识</h3>
<p>xmlns 用于声明以下内容适用于安卓，因为 XML 语言也运用于制作网页或者其他功能。http://stackoverflow.com/questions/1181888/what-does-xmlns-in-xml-mean<br>
setting→Editor→Font 调整编辑器的字体和大小</p>
<ul>
<li>这里给你一点建议。为了流畅的使用 Android Studio，最好把其他程序都关掉，将电脑（尤其是笔记本）调整至高性能模式。然后在手机上查看此教程。<br>
然后让我们在模拟器或者手机上运行吧。</li>
<li>小建议：如果你的电脑卡得出翔，那最好还是不要使用模拟器了，用手机吧。比如我用三星a60，因为我的电脑是差不多十年前的ASUS，尽管4G内存，处理器也力不从心。</li>
</ul>
<h3 id="在手机上运行">在手机上运行</h3>
<p>请参考：https://developer.android.google.cn/studio/run/device<br>
确认绿色的运行左边的框里写的是你的手机型号，那表示连接成功了。<br>
成功运行！<br>
如果没有成功也不要灰心，试着在网上找找答案。有一种说法是要在设置的Android SDK 中安装手机对应的版本，但是我的安卓9也没安装啊😂，反而是装了安卓10。还有一种说法是要到设备管理器中找到 ADB 设备并右键更新。</p>
<ul>
<li>我的运行方式：安装三星的驱动，打开USB调试，连上电脑一会儿就好了😊。<br>
尝试完成后请别忘记中止。</li>
</ul>
<h3 id="在模拟器上运行">在模拟器上运行</h3>
<p>操作指南：https://developer.android.google.cn/studio/run/emulator</p>
<h2 id="校检后补充一段时间后">校检后补充（一段时间后）</h2>
<p>事实证明 Android Studio 4.0 Preview 也是可以使用离线模式的。但是 4.0 的代码补全有一些问题，它补全的不是接下来的属性名，而是属性的属性的属性……（一直到底那一种）所以目前不是很方便使用。</p>

                </div>
                <div class="clear"></div>
              </section>
            </article>
            <div class="clear"></div>

            <section class="related section">
              
              <article class="prev grid-50 tablet-grid-50 grid-parent">
                <div class="thumb cover lazy loaded" style="background-image: url('https://Jason-summer.github.io/post-images/the-foundation-of-my-blog.jpg');"></div>
                 <a href="https://Jason-summer.github.io/post/the-foundation-of-my-blog/" class="full-link"></a>
                 <div class="info">
                  <time datetime="2020-04-03">2020-04-03</time>
                  <h4 class="title white no-margin">“避风港”的诞生日记</h4>
                </div>
                 <span class="epcl-button red">
                  <img src="https://Jason-summer.github.io/media/images/left-arrow.svg" width="15" alt="Left Arrow">
                </span>
                <div class="overlay"></div>
              </article>
              
              
              <article class="next grid-50 tablet-grid-50 grid-parent">
                <div class="thumb cover lazy loaded" style="background-image: url('https://Jason-summer.github.io/post-images/hello-gridea.png');"></div>
                 <a href="https://Jason-summer.github.io/post/hello-gridea/" class="full-link"></a>
                 <div class="info">
                  <time datetime="2018-12-12">2018-12-12</time>
                  <h4 class="title white no-margin">Hello Gridea</h4>
                </div>
                 <span class="epcl-button red">
                  <img src="https://Jason-summer.github.io/media/images/right-arrow.svg" width="15" alt="Left Arrow">
                </span>
                <div class="overlay"></div>
              </article>
              

                <div class="clear"></div>
            </section>

              <div class="clear"></div>
              
            
              <div id="comments" class="bg-white hosted ">
                
                  <link rel="stylesheet" href="https://unpkg.com/gitalk/dist/gitalk.css">
<script src="https://unpkg.com/gitalk/dist/gitalk.min.js"></script>

<div id="gitalk-container"></div>
<div class="clear"></div>

<script>
  var gitalk = new Gitalk({
    clientID: 'd58ad16ad66ee00d3bc5',
    clientSecret: 'ac26e1eeae0d0cb7e660f5cfe7d5139eea8fb3fd',
    repo: 'Jason-summer.github.io',
    owner: 'Jason-summer',
    admin: ['Jason-summer'],
    id: (location.pathname).substring(0, 49),      // Ensure uniqueness and length less than 50
    distractionFreeMode: false  // Facebook-like distraction free mode
  })

  gitalk.render('gitalk-container')
</script>

                
                
              </div>
            

            </div>
          </div>
      </main>

          <footer id="footer" class="grid-container">
        <div class="widgets row gradient-effect">
            <div class="default-sidebar border-effect">
              <div class="grid-33 tablet-grid-50 mobile-grid-100">
                <section id="tag_cloud-2" class="widget widget_epcl_posts_thumbs underline-effect">
                  <h4 class="widget-title title white bordered">最新文章</h4>
                  
                  
                  <article class="item post-0 post type-post status-publish format-standard has-post-thumbnail hentry">
                    <a href="https://Jason-summer.github.io/post/the-experience-of-my-blog/" class="thumb hover-effect">
                      <span class="fullimage cover" style="display:block;border-radius:50%;background-image: url('/media/images/gridea.jpg');"></span>
                    </a>
                    <div class="info gradient-effect">
                      <time datetime="2020-04-28">2020-04-28</time>
                      <h4 class="title usmall">
                        <a href="https://Jason-summer.github.io/post/the-experience-of-my-blog/">建立个人博客的探索历程</a>
                      </h4>
                    </div>
                    <div class="clear"></div>
                  </article>
                  
                  
                  
                  <article class="item post-1 post type-post status-publish format-standard has-post-thumbnail hentry">
                    <a href="https://Jason-summer.github.io/post/mozilla-supports-the-open-covid-pledge-making-intellectual-property-freely-available-for-the-fight-against-covid-19/" class="thumb hover-effect">
                      <span class="fullimage cover" style="display:block;border-radius:50%;background-image: url('https://Jason-summer.github.io/post-images/mozilla-supports-the-open-covid-pledge-making-intellectual-property-freely-available-for-the-fight-against-covid-19.png');"></span>
                    </a>
                    <div class="info gradient-effect">
                      <time datetime="2020-04-25">2020-04-25</time>
                      <h4 class="title usmall">
                        <a href="https://Jason-summer.github.io/post/mozilla-supports-the-open-covid-pledge-making-intellectual-property-freely-available-for-the-fight-against-covid-19/">Mozilla 支持“开放冠状病毒协议”：为了战胜 COVID-19 开放使用知识产权</a>
                      </h4>
                    </div>
                    <div class="clear"></div>
                  </article>
                  
                  
                  
                  <article class="item post-2 post type-post status-publish format-standard has-post-thumbnail hentry">
                    <a href="https://Jason-summer.github.io/post/3-more/" class="thumb hover-effect">
                      <span class="fullimage cover" style="display:block;border-radius:50%;background-image: url('/media/images/gridea.jpg');"></span>
                    </a>
                    <div class="info gradient-effect">
                      <time datetime="2020-04-13">2020-04-13</time>
                      <h4 class="title usmall">
                        <a href="https://Jason-summer.github.io/post/3-more/">#3 More</a>
                      </h4>
                    </div>
                    <div class="clear"></div>
                  </article>
                  
                  
                  
                  
                  
                  
                  
                  
                  
                  
                  
                  
                  
                  
                  
                  
                  
                  
                  
                  
                  
                  
                  <div class="clear"></div>
                </section>
              </div>

              <div class="grid-33 tablet-grid-50 mobile-grid-100">
                <section id="tag_cloud-2" class="widget widget_tag_cloud underline-effect">
                  <h4 class="widget-title title white bordered">标签云</h4>
                  <div class="tagcloud">
                    
                      <a href="https://Jason-summer.github.io/tag/OOmQpIJga/" class="ctag ctag-0 ctag-OOmQpIJga" aria-label="">Gridea</a>
                    
                      <a href="https://Jason-summer.github.io/tag/translation/" class="ctag ctag-1 ctag-translation" aria-label="">翻译训练</a>
                    
                      <a href="https://Jason-summer.github.io/tag/markdown/" class="ctag ctag-2 ctag-markdown" aria-label="">Markdown</a>
                    
                      <a href="https://Jason-summer.github.io/tag/itPlsg2cI/" class="ctag ctag-3 ctag-itPlsg2cI" aria-label="">开发</a>
                    
                  </div>
                  <div class="clear"></div>
                </section>
              </div>

              <div class="grid-33 tablet-grid-50 mobile-grid-100">
                <section id="epcl_about-2" class="widget widget_epcl_about underline-effect">
                  <h4 class="widget-title title white bordered">关于我</h4>
                  <div class="avatar">
                    <a href="" class="translate-effect thumb"><span class="fullimage cover" style="background-image: url(https://Jason-summer.github.io/images/avatar.png);"></span></a>
                  </div>
                  <div class="info">
                    <h4 class="title small author-name gradient-effect no-margin"><a href="">夏元素的避风塘</a></h4>
                    <p class="founder">理想生活+</p>
                    <div class="social">
                      
                          
                            <a href="https://github.com/Jason-summer" class="translate-effect" target="_blank"><i class="fa fa-github"></i></a>
                        
                      
                        
                      
                        
                      
                        
                      
                          
                            <a href="https://jason-summer.github.io/atom.xml" class="translate-effect" target="_blank"><i class="fa fa-feed"></i></a>
                        
                      
                    </div> 
                  </div>
                  <div class="clear"></div>
                  </section>
              </div>

            </div>
            <div class="clear"></div>
        </div>

        <div class="logo">
          <a href="https://Jason-summer.github.io"><img src="/media/images/gridea.png" alt=""></a>
        </div>
        <p class="published border-effect">
          ©2019 共 13 篇文章
          <br/>
          Theme <a href="https://gridea.dev/" target="_blank">「breek」</a> Powered by <a href="https://gridea.dev/" target="_blank">「Gridea」</a>
        </p>
        
        <a href="javascript:void(0)" id="back-to-top" class="epcl-button dark" style="display:none">
          <i class="fa fa-arrow"></i>
        </a>
    </footer>
    
    <div class="clear"></div>

        

      
    <script src="https://Jason-summer.github.io/media/js/functions-post.js"></script>

    </div>
    <!-- end: #wrapper -->
  </body>
</html>
